﻿using System;
using System.Collections.Generic;
using System.Linq;
using System.Web;
using System.Web.UI;
using System.Web.UI.WebControls;

namespace WebClient.Controls
{
    public partial class loaiSPMenu : System.Web.UI.UserControl
    {
        protected void Page_Load(object sender, EventArgs e)
        {
            if(!this.IsPostBack)
                LoadMenu();
        }

        private void LoadMenu() { 
            //Session

            WebData db = new WebData();
            String strIl = "";
            int i = 0;
            DTO.Groupproducts []list = db.GetAllGroupproducts();            
            DTO.Products[] products = db.GetAllProducts();
            String s = "";
            foreach (DTO.Groupproducts item in list)
            {
                strIl = strIl + "<br/><li id=\"lil_"+ i.ToString() + "\">"
                    + "<a href=\"List.aspx?id=" + item.id +"\"> " + item.name +"</a>";                
                i ++;                
                strIl = strIl + "</li>";
            }
            lblListProducts.Text = strIl;
            
        }
    }
}